﻿<link rel="stylesheet" href="~/libs/bower/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="~/libs/bower/material-design-iconic-font/dist/css/material-design-iconic-font.css">
<!-- build:css ..//assets/css/app.min.css -->
<link rel="stylesheet" href="~/libs/bower/animate.css/animate.min.css">
<link rel="stylesheet" href="~/libs/bower/fullcalendar/dist/fullcalendar.min.css">
<link rel="stylesheet" href="~/libs/bower/perfect-scrollbar/css/perfect-scrollbar.css">
<link rel="stylesheet" href="~/assets/css/bootstrap.css">
<link rel="stylesheet" href="~/assets/css/app.css">
<link rel="stylesheet" href="~/assets/css/style.css">
<!-- endbuild -->
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Raleway:400,500,600,700,800,900,300">
<div class="modal-body">
    <form role="form" id="form1">
        <div class="form-group">
            <label for="exampleInputEmail1">主题：</label>
            <input type="text" class="form-control" id="Title" name="Title" placeholder="主题" required>
        </div>
        <div class="form-group">
            <label for="exampleInputPassword2">接收编号：</label>
            <input type="text" readonly="readonly" value="admin" required class="form-control" id="ReciveCode" name="ReciveCode" placeholder="">
        </div>
        <div class="form-group">
            <label for="exampleInputPassword3">具体内容：</label>
            <textarea class="form-control" name="MContent" required placeholder="具体内容" rows="3" id="MContent"></textarea>
        </div>
    </form>
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
    <button type="button" id="btn1" class="btn btn-primary" >确定提交</button>
</div>
<script src="~/scripts/jquery-1.10.2.min.js"></script>
<script src="~/layer/layer.js"></script>
<!--========== END app main -->
<script src="~/libs/bower/jquery-ui/jquery-ui.min.js"></script>
<script src="~/libs/bower/jQuery-Storage-API/jquery.storageapi.min.js"></script>
<script src="~/libs/bower/bootstrap-sass//assets/javascripts/bootstrap.js"></script>
<script src="~/libs/bower/superfish/dist/js/hoverIntent.js"></script>
<script src="~/libs/bower/superfish/dist/js/superfish.js"></script>
<script src="~/libs/bower/jquery-slimscroll/jquery.slimscroll.js"></script>
<script src="~/libs/bower/perfect-scrollbar/js/perfect-scrollbar.jquery.js"></script>
<script src="~/libs/bower/PACE/pace.min.js"></script>
<!-- endbuild -->
<!-- build:js ..//assets/js/app.min.js -->
<script src="~/assets/js/library.js"></script>
<script src="~/assets/js/plugins.js"></script>
<script src="~/assets/js/app.js"></script>
<!-- endbuild -->
<script src="~/libs/bower/moment/moment.js"></script>
<script src="~/libs/bower/fullcalendar/dist/fullcalendar.min.js"></script>
<script src="~/assets/js/fullcalendar.js"></script>
<script src="~/DirectSellJs/jquery.unobtrusive-ajax.min.js"></script>
<script src="~/scripts/jquery.signalR-2.4.0.js"></script>
<script type="text/javascript">
    $(function () {
        var connection = $.connection("/Connections/ChatConnections");
        connection.received(function (data) {
        });

        connection.start().done(function () {
            $("#btn1").click(function () {
                layer.msg('确定发起留言？', {
                    time: 0 //不自动关闭
                    , btn: ['确定', '取消']
                    , btn1: function (index) {
                        //加载层
                        var index = layer.load(1, {
                            shade: [0.1, '#fff']
                        });
                        $.ajax({
                            type: "post",
                            url: "/User/Message/SendMessage",
                            data: $('#form1').serialize(),
                        }).success(function (message) {
                            connection.send(message);
                            layer.msg(message, { icon: 1 });
                            var index = parent.layer.getFrameIndex(window.name);//获取当前弹出层的层级
                            window.parent.location.reload();//刷新父页面
                            parent.layer.close(index);//关闭弹出层
                        }).fail(function (err) {
                            layer.msg('系统错误,请稍后重试', { icon: 2 });
                        })
                        layer.close(index)//关闭加载层
                    }, btn2: function (index) {
                        layer.close();
                    }
                });
            });
        });

    });
</script>